from fastapi.responses import JSONResponse


def json_response(code=200, msg="", data={}):
    """
    定义json response
    :param code: 状态码
    :param msg: 状态信息
    :param data: 数据
    :return:
    """
    return JSONResponse(dict(result=data, code=code, msg=msg))
